/**
 * 服务器总数据集
 * */
package riki.org.com.date
{
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	
	import riki.org.com.model.ModelLocator;
	
	public class DataBase extends EventDispatcher
	{
		//游戏信息列表
		public	var	ServerApplicationList	:Array				=	new	Array();
		public	var	BindingList				:ArrayCollection	=	new	ArrayCollection();
		public	var downloadinfolist		:ArrayCollection;
		public	var playinfolist			:ArrayCollection;
		public	var fileinfolist			:Array;
		
		public	function	getApplicationInfo(AppName:String):OnlineApps
		{
			var pSize:int	=	ServerApplicationList.length;
			for(var i:int = 0 ; i < pSize ; i ++)
			{
				var app:OnlineApps	=	OnlineApps(ServerApplicationList[i]);
				if(app.appName	==	AppName)
				{
					return app;
				}
			}
			return null;
		}
		
		public	function	toBindingList():void
		{
			trace("BindingList")
			
			var pSize:int				=	ModelLocator.getInstance().sDataBase.ServerApplicationList.length;
			for(var i:int = 0 ; i < pSize ; i ++)
			{
				var app:OnlineApps	=	OnlineApps(ServerApplicationList[i]);
				BindingList.addItem({label:app.name,data:app.appName});
			}
		}
	}
}